package cesdentalrecord.dao.controller;

import cesdentalrecord.dao.BaseStudentPeer;
import cesdentalrecord.dao.Student;
import cesdentalrecord.dao.StudentManager;
import java.util.List;

import org.apache.torque.util.Criteria;

public class ViewAllStudentsController {
	
	public List<Student> validateViewAllStudentRequest(){
		return StudentManager.retrieveAllStudents();
		
	}
	
	public Criteria sortAllStudents(Criteria data) {
		
		data.addAscendingOrderByColumn(BaseStudentPeer.GRADE);
		data.addAscendingOrderByColumn(BaseStudentPeer.SECTION);

			data.addDescendingOrderByColumn(BaseStudentPeer.GENDER);
			data.addAscendingOrderByColumn(BaseStudentPeer.SURNAME);
					
			return data;
		}
}
